<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>办学条件</title>
<link href="/styles/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
	
	function pagefor(a){
		
		var p = a.value;
		//alert(p);
		$.post("/major/ajax",{userid:-1,current:p},function(data){
			
			//alert(data.list.length);
			$("#count").html(data.count);
			$("#total").html(data.total);
			$("#current").html(data.current);
			var html="";
			 for(var i=0;i<data.list.length;i++){
				 
				html+="<tr>";
				html+="<td>"+data.list[i].mdate+"</td>";
				html+="<td><a href='/major/onemajor?majorid="+data.list[i].majorid+"'>查看年度专业填报记录</a></td>";
				html+="</tr>";
			 } 
			 $("#pagemajor").html("");
			 $("#pagemajor").append(html);
		},"json");
	}
	function pageup(){
		
		var c=$("#current").html();
		var current = Number(c)-1;
		
		$.post("/major/ajax",{userid:-1,current:current},function(data){
			
			$("#count").html(data.count);
			$("#total").html(data.total);
			$("#current").html(data.current);
			var html="";
			 for(var i=0;i<data.list.length;i++){
				 
				html+="<tr>";
				html+="<td>"+data.list[i].mdate+"</td>";
				html+="<td><a href='/major/onemajor?majorid="+data.list[i].majorid+"'>查看年度专业填报记录</a></td>";
				html+="</tr>";
			 } 
			 $("#pagemajor").html("");
			 $("#pagemajor").append(html);
		},"json");
	}
	function pagedown(){
		
		var c =  $("#current").html();
		var current=Number(c)+1;
		
		$.post("/major/ajax",{userid:-1,current:current},function(data){
			
			//alert(data.list.length);
			
			$("#count").html(data.count);
			$("#total").html(data.total);
			$("#current").html(data.current);
			var html="";
			 for(var i=0;i<data.list.length;i++){
				 
				html+="<tr>";
				html+="<td>"+data.list[i].mdate+"</td>";
				html+="<td><a href='/major/onemajor?majorid="+data.list[i].majorid+"'>查看年度专业填报记录</a></td>";
				html+="</tr>";
			 } 
			 $("#pagemajor").html("");
			 $("#pagemajor").append(html);
		},"json");
	}
	
	
	function spagefor(a){
			
			var p = a.value;
			//alert(p);
			$.post("/school/ajax",{userid:-1,current:p},function(data){
				
				//alert(data.list.length);
				$("#scount").html(data.count);
				$("#stotal").html(data.total);
				$("#scurrent").html(data.current);
				var html="";
				 for(var i=0;i<data.list.length;i++){
					 
					html+="<tr>";
					html+="<td>"+data.list[i].sdate+"</td>";
					html+="<td><a href='/school/oneschool?sid="+data.list[i].sid+"'>查看年度办学填报记录</a></td>";
					html+="</tr>";
				 } 
				 $("#spagemajor").html("");
				 $("#spagemajor").append(html);
			},"json");
		}
	function spageup(){
		
		var c =  $("#scurrent").html();
		var current=Number(c)-1;
		
		$.post("/school/ajax",{userid:-1,current:current},function(data){
			
			//alert(data.list.length);
			
			$("#scount").html(data.count);
			$("#stotal").html(data.total);
			$("#scurrent").html(data.current);
			var html="";
			 for(var i=0;i<data.list.length;i++){
				 
				html+="<tr>";
				html+="<td>"+data.list[i].sdate+"</td>";
				html+="<td><a href='/school/oneschool?sid="+data.list[i].sid+"'>查看年度办学填报记录</a></td>";
				html+="</tr>";
			 } 
			 $("#spagemajor").html("");
			 $("#spagemajor").append(html);
		},"json");
	}
	
	function spagedown(){
			
			var c=$("#scurrent").html();
			var current = Number(c)+1;
			
			$.post("/school/ajax",{userid:-1,current:current},function(data){
				
				$("#scount").html(data.count);
				$("#stotal").html(data.total);
				$("#scurrent").html(data.current);
				var html="";
				 for(var i=0;i<data.list.length;i++){
					 
					html+="<tr>";
					html+="<td>"+data.list[i].sdate+"</td>";
					html+="<td><a href='/school/oneschool?sid="+data.list[i].sid+"'>查看年度办学填报记录</a></td>";
					html+="</tr>";
				 } 
				 $("#spagemajor").html("");
				 $("#spagemajor").append(html);
			},"json");
		}
</script>
</head>
<body>

	<br />
	<br />
	<table class="table11" style="width: 500px;">
		<thead>
			<tr>
				<th colspan="2" style="text-align: center;">某某学校历年来办学条件情况</th>
			</tr>
			<tr>
				<th>时间</th>
				<th>信息</th>
			</tr>
		</thead>
		<tbody id="spagemajor">
			<c:forEach items="${page.list }" var="item">
				<tr>
					<td>${item.sdate }</td>
					<td><a href="/school/oneschool?sid=${item.sid }">年度办学条件填报记录</a></td>
				</tr>
			</c:forEach>
		</tbody>
		<tr>
			<td colspan="2">总共有<span class="red" id="scount">${page.count }</span>条记录，总共有<span
				class="red" id="stotal">${page.total }</span>页，当前第<span class="red" id="scurrent">${page.current}</span>页。
				<a id="First" href="#">首页</a> <a id="Prev" href="#" onclick="spageup();">上一页</a> <a
				id="Next" href="#" onclick="spagedown();">下一页</a> <a id="Last" href="/school/schoollist?current=${page.total}">尾页</a> 转到第 <select
				name="GoTo" id="sGoTo" onchange="spagefor(this)">
					<c:forEach begin="1" end="${page.total }" step="1" var="index">
						<option value="${index }">${index }</option>
					</c:forEach>
			</select>页
			</td>
		</tr>
	</table>
	
	
	
	
	
	
	
	
	
	
	<table class="table11" style="width: 500px;">
		
		<thead>
		<tr>
			<th colspan="2" style="text-align: center;">某某学校历年来专业课程填报情况</th>
		</tr>
		<tr>
			<th>时间</th>
			<th>信息</th>
		</tr>
		</thead>
		
		
		<tbody id="pagemajor">
		<c:forEach items="${pagemajor.list }" var="item" >
			<tr>
				<td>${item.mdate }</td>
				<td><a href="/major/onemajor?majorid=${item.majorid }">年度专业填报记录</a></td>
			</tr>
		</c:forEach> 
		</tbody>
		<tr>
			<td colspan="2">总共有<span class="red" id="count">${pagemajor.count }</span>条记录，总共有<span
				class="red" id="total">${pagemajor.total }</span>页，当前第<span class="red" id="current">${pagemajor.current}</span>页。
				<a id="First" href="#">首页</a> <a id="Prev" href="#" onclick="pageup();">上一页</a> <a
				id="Next" href="#" onclick="pagedown();">下一页</a> <a id="Last" href="/major/majorlist?current=${pagemajor.total}">尾页</a> 转到第 <select
				name="GoTo" id="GoTo" onchange="pagefor(this);">
					<c:forEach begin="1" end="${pagemajor.total }" step="1" var="index">
						<option value="${index }">${index }</option>
					</c:forEach>
			</select>页
			</td>
		</tr>
	</table>
</body>
</html>